You are here: Understanding the Meridian object model > About the Document object > The Document object methods > MoveTo method

MoveTo method

Moves the current document to the specified folder.

Syntax

MoveTo(TargetFolder As IASFolder3, [Options As Long = 0])
Parameters
Name Description

TargetFolder

An object that represents the folder to which to move the current document object.

Options

Optional long integer that represents one or more AS_MOVE_OPTIONS constants.

Remarks

This method does nothing if the document already resides in the target folder. This method does not support Field-Path definition levels.

When this method is called, any property values set by code are reset to their original values.

If this method is used in event procedures such as DocGenericEvent_AfterNewDocument, an unhandled exception Cannot delete a relation. The object is already being edited by another session can occur. This can happen if the folder to which the document is being moved is locked, such as by another new document wizard in use by another user at the same time. This is likely to happen if event procedures are customized to provide automatic document storage together with the Meridian Advanced Project Workflow Module so that it works similar to a Field-Path definition. To work around this problem, you can configure the default location of document copies as described in the BlueCielo Meridian Enterprise Configuration Guide.

For the wizard events to occur for this method, the MoveEvents setting in the [ScriptEvents] section on the Application Integration tab of Application Settings in Configurator must be set to Y (default).

Tip    To use this method to move documents to folders that users are not granted Create Document privilege, grant them the Create Document from Script privilege for the destination folder. The privilege may only be granted for custom folder types , not normal folders.

Related concepts

About the Document object